#include "kcapi.h"
#include <stdio.h>
#include <string.h>
#define MD5_DIGEST_LENGTH 16

int main()
{

    unsigned char md[MD5_DIGEST_LENGTH] = {0};
    char buf[] = "hello world!!!!!!!!!";
    struct kcapi_handle *handle;
    kcapi_md_init(&handle, "md5", KCAPI_ACCESS_SENDMSG);
    kcapi_md_update(handle, buf, strlen(buf));
    kcapi_md_final(handle, md, MD5_DIGEST_LENGTH);
    puts("************************************");
    for (int i = 0; i < MD5_DIGEST_LENGTH; i++)
        printf("%02x", md[i]);
    printf("\n");
    kcapi_md_destroy(handle);
    puts("************************************");
    return 0;
}